from selenium.webdriver.common.by import By


class LoginPageLocators:
    # 手机号输入框
    PHONE_INPUT = (By.NAME, "loginname")
    # 验证码输入框
    YZM_INPUT = (By.NAME, "phonecode")
    # 验证码按钮
    YZM_BUTTON = (By.ID, "get_yzm_m")
    # 登陆按钮
    LOGIN_BUTTON = (By.ID, "subBtn_m")
    # 验证码图像框
    GEETEST_WINDOW = (By.CLASS_NAME, "geetest_window")
    # 验证码滑块
    SLIDE_BUTTON = (By.CLASS_NAME, "geetest_slider_button")
    # 验证后结果
    RESULT_CONTENT = (By.CLASS_NAME, "geetest_result_box")


class HomePageLocators:
    # 职位搜索页跳转链接
    JOB_SEARCH_LINK = (By.LINK_TEXT, "职位搜索")


class SearchPageLocators:
    # 点击工作职能按钮进行弹窗
    JOB_FUNC_BUTTON = (By.CLASS_NAME, "e_e.e_com")
    # 获得级联工作职能筛选表，共三个
    CASCADER_MENUS = (By.CLASS_NAME, "cascader_panel_menu")
    JOB_FUNC_ITEMS = (By.CLASS_NAME, "func-item")
    # 点击展开所有城市弹窗
    CITY_CHOICE_DIV = (By.CLASS_NAME, "allcity")
    # 获得城市弹窗上左侧城市筛选区域
    CITY_SCREEN_TABS = (By.CLASS_NAME, "el-tabs__item.is-left")
    # 获得城市弹窗上右侧城市区域
    CITY_GRID_ITEMS = (By.CLASS_NAME, "el-tab-pane")
    # 获得“热门城市”网格布局中的所有城市元素
    # 获得“展开选项”元素
    # 通过css获得span项
    SPAN_ITEM = (By.CSS_SELECTOR, "span")
    # 获得城市弹窗上的确定按钮
    CITY_CERTAIN_BUTTON = (By.CLASS_NAME, "el-button.el-button--primary")
    # 点击"展开选项"按钮
    CARRY_BOX = (By.CLASS_NAME, "carrybox")
    # 展开选项后会出现之前未出现的
    LAUNCH_BOX = (By.CLASS_NAME, "launchbox.open")
    # 获得每一个筛选行
    F_BOX = (By.CLASS_NAME, "fbox")
    # 获得当前页面上的职业块
    JOB_BLOCKS = (By.CLASS_NAME, "e.sensors_exposure")
    # 下一页按钮
    NEXT_BUTTON = (By.CLASS_NAME, "btn-next")
